<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- QCtmInputDialog.cpp -->
  <meta name="description" content="功能与QInputDialog相同，实现了QCustomUi的窗口风格.">
  <title>QCtmInputDialog Class | QCustomUi 1.19.0</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
    <div class="main">
    <div class="main-rounded">
        <div class="navigationbar">
        <ul>
<li><a href="index.html">QCustomUi 1.19.0</a></li>
<li><a href="qcustomui-module.html" translate="no">QCustomUi</a></li>
<li>QCtmInputDialog</li>
<li id="buildversion">QCustomUi 1.19.0 Reference Documentation</li>
    </ul>
    </div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3 id="toc">Contents</h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#static-public-members">Static Public Members</a></li>
<li class="level1"><a href="#reimplemented-protected-functions">Reimplemented Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title" translate="no">QCtmInputDialog Class</h1>
<!-- $$$QCtmInputDialog-brief -->
<p>功能与<a href="https://doc.qt.io/qt/qinputdialog.html" translate="no">QInputDialog</a>相同，实现了<a href="qcustomui-module.html" translate="no">QCustomUi</a>的窗口风格. <a href="#details">More...</a></p>
<!-- @@@QCtmInputDialog -->
<div class="table"><table class="alignedsummary requisites" translate="no">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign"> <code translate="no">#include &lt;QCtmInputDialog.h&gt;</code></td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> Inherits:</td><td class="memItemRight bottomAlign"> QInputDialog</td></tr>
</table></div>
<ul>
<li><a href="qctminputdialog-members.html">List of all members, including inherited members</a></li>
</ul>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary" translate="no">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qctminputdialog.html#QCtmInputDialog" translate="no">QCtmInputDialog</a></b>(QWidget *<i>parent</i> = nullptr, Qt::WindowFlags <i>flags</i> = Qt::WindowFlags())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qctminputdialog.html#dtor.QCtmInputDialog" translate="no">~QCtmInputDialog</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qctminputdialog.html#removeTitleBar" translate="no">removeTitleBar</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qctminputdialog.html#setTitleBar" translate="no">setTitleBar</a></b>(QCtmTitleBar *<i>titleBar</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QCtmTitleBar *</td><td class="memItemRight bottomAlign"><b><a href="qctminputdialog.html#titleBar" translate="no">titleBar</a></b>() const</td></tr>
</table></div>
<h2 id="static-public-members">Static Public Members</h2>
<div class="table"><table class="alignedsummary" translate="no">
<tr><td class="memItemLeft rightAlign topAlign"> double </td><td class="memItemRight bottomAlign"><b><a href="qctminputdialog.html#getDouble" translate="no">getDouble</a></b>(QWidget *<i>parent</i>, const QString &amp;<i>title</i>, const QString &amp;<i>label</i>, double <i>value</i> = 0, double <i>minValue</i> = -2147483647, double <i>maxValue</i> = 2147483647, int <i>decimals</i> = 1, bool *<i>ok</i> = nullptr, Qt::WindowFlags <i>flags</i> = Qt::WindowFlags(), double <i>step</i> = 1)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qctminputdialog.html#getInt" translate="no">getInt</a></b>(QWidget *<i>parent</i>, const QString &amp;<i>title</i>, const QString &amp;<i>label</i>, int <i>value</i> = 0, int <i>minValue</i> = -2147483647, int <i>maxValue</i> = 2147483647, int <i>step</i> = 1, bool *<i>ok</i> = nullptr, Qt::WindowFlags <i>flags</i> = Qt::WindowFlags())</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qctminputdialog.html#getItem" translate="no">getItem</a></b>(QWidget *<i>parent</i>, const QString &amp;<i>title</i>, const QString &amp;<i>label</i>, const QStringList &amp;<i>items</i>, int <i>current</i> = 0, bool <i>editable</i> = true, bool *<i>ok</i> = nullptr, Qt::WindowFlags <i>flags</i> = Qt::WindowFlags(), Qt::InputMethodHints <i>inputMethodHints</i> = Qt::ImhNone)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qctminputdialog.html#getMultiLineText" translate="no">getMultiLineText</a></b>(QWidget *<i>parent</i>, const QString &amp;<i>title</i>, const QString &amp;<i>label</i>, const QString &amp;<i>text</i> = QString(), bool *<i>ok</i> = nullptr, Qt::WindowFlags <i>flags</i> = Qt::WindowFlags(), Qt::InputMethodHints <i>inputMethodHints</i> = Qt::ImhNone)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qctminputdialog.html#getText" translate="no">getText</a></b>(QWidget *<i>parent</i>, const QString &amp;<i>title</i>, const QString &amp;<i>label</i>, QLineEdit::EchoMode <i>echo</i> = QLineEdit::Normal, const QString &amp;<i>text</i> = QString(), bool *<i>ok</i> = nullptr, Qt::WindowFlags <i>flags</i> = Qt::WindowFlags(), Qt::InputMethodHints <i>inputMethodHints</i> = Qt::ImhNone)</td></tr>
</table></div>
<h2 id="reimplemented-protected-functions">Reimplemented Protected Functions</h2>
<div class="table"><table class="alignedsummary" translate="no">
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qctminputdialog.html#event" translate="no">event</a></b>(QEvent *<i>e</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qctminputdialog.html#hideEvent" translate="no">hideEvent</a></b>(QHideEvent *) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qctminputdialog.html#nativeEvent" translate="no">nativeEvent</a></b>(const QByteArray &amp;<i>eventType</i>, void *<i>message</i>, qintptr *<i>result</i>) override</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qctminputdialog.html#showEvent" translate="no">showEvent</a></b>(QShowEvent *<i>e</i>) override</td></tr>
</table></div>
<!-- $$$QCtmInputDialog-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
</div>
<!-- @@@QCtmInputDialog -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QCtmInputDialog[overload1]$$$QCtmInputDialogQWidget*Qt::WindowFlags -->
<h3 class="fn" translate="no" id="QCtmInputDialog"><code class="details extra" translate="no">[explicit]</code> QCtmInputDialog::<span class="name">QCtmInputDialog</span>(<span class="type"><a href="https://doc.qt.io/qt/qwidget.html#QWidget" translate="no">QWidget</a></span> *<i>parent</i> = nullptr, <span class="type"><a href="https://doc.qt.io/qt/qt.html#WindowType-enum" translate="no">Qt::WindowFlags</a></span> <i>flags</i> = Qt::WindowFlags())</h3>
<p>构造函数 <i translate="no">parent</i>, <i translate="no">flags</i>.</p>
<!-- @@@QCtmInputDialog -->
<!-- $$$~QCtmInputDialog[overload1]$$$~QCtmInputDialog -->
<h3 class="fn" translate="no" id="dtor.QCtmInputDialog"><code class="details extra" translate="no">[virtual noexcept]</code> QCtmInputDialog::<span class="name">~QCtmInputDialog</span>()</h3>
<p>析构函数.</p>
<!-- @@@~QCtmInputDialog -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn" translate="no" id="event"><code class="details extra" translate="no">[override virtual protected]</code> <span class="type">bool</span> QCtmInputDialog::<span class="name">event</span>(<span class="type"><a href="https://doc.qt.io/qt/qevent.html" translate="no">QEvent</a></span> *<i>e</i>)</h3>
<p>Reimplements: <a href="https://doc.qt.io/qt/qwidget.html#event" translate="no">QWidget::event</a>(QEvent *event).</p>
<!-- @@@event -->
<!-- $$$getDouble[overload1]$$$getDoubleQWidget*constQString&constQString&doubledoubledoubleintbool*Qt::WindowFlagsdouble -->
<h3 class="fn" translate="no" id="getDouble"><code class="details extra" translate="no">[static]</code> <span class="type">double</span> QCtmInputDialog::<span class="name">getDouble</span>(<span class="type"><a href="https://doc.qt.io/qt/qwidget.html#QWidget" translate="no">QWidget</a></span> *<i>parent</i>, const <span class="type"><a href="https://doc.qt.io/qt/qstring.html" translate="no">QString</a></span> &amp;<i>title</i>, const <span class="type"><a href="https://doc.qt.io/qt/qstring.html" translate="no">QString</a></span> &amp;<i>label</i>, <span class="type">double</span> <i>value</i> = 0, <span class="type">double</span> <i>minValue</i> = -2147483647, <span class="type">double</span> <i>maxValue</i> = 2147483647, <span class="type">int</span> <i>decimals</i> = 1, <span class="type">bool</span> *<i>ok</i> = nullptr, <span class="type"><a href="https://doc.qt.io/qt/qt.html#WindowType-enum" translate="no">Qt::WindowFlags</a></span> <i>flags</i> = Qt::WindowFlags(), <span class="type">double</span> <i>step</i> = 1)</h3>
<p>弹出显示一个浮点数输入窗口，并返回输入的值， 父窗口为 <i translate="no">parent</i>, 标题栏为 <i translate="no">title</i>, 显示信息为 <i translate="no">label</i>, 值为 <i translate="no">value</i>, 最小值为 <i translate="no">minValue</i>, 最大值为 <i translate="no">maxValue</i>, 保留小数位为 <i translate="no">decimals</i>, 是否点击确定按钮 <i translate="no">ok</i>, 窗口标志位为 <i translate="no">flags</i>, 步进为 <i translate="no">step</i>.</p>
<!-- @@@getDouble -->
<!-- $$$getInt[overload1]$$$getIntQWidget*constQString&constQString&intintintintbool*Qt::WindowFlags -->
<h3 class="fn" translate="no" id="getInt"><code class="details extra" translate="no">[static]</code> <span class="type">int</span> QCtmInputDialog::<span class="name">getInt</span>(<span class="type"><a href="https://doc.qt.io/qt/qwidget.html#QWidget" translate="no">QWidget</a></span> *<i>parent</i>, const <span class="type"><a href="https://doc.qt.io/qt/qstring.html" translate="no">QString</a></span> &amp;<i>title</i>, const <span class="type"><a href="https://doc.qt.io/qt/qstring.html" translate="no">QString</a></span> &amp;<i>label</i>, <span class="type">int</span> <i>value</i> = 0, <span class="type">int</span> <i>minValue</i> = -2147483647, <span class="type">int</span> <i>maxValue</i> = 2147483647, <span class="type">int</span> <i>step</i> = 1, <span class="type">bool</span> *<i>ok</i> = nullptr, <span class="type"><a href="https://doc.qt.io/qt/qt.html#WindowType-enum" translate="no">Qt::WindowFlags</a></span> <i>flags</i> = Qt::WindowFlags())</h3>
<p>弹出显示一个整数输入窗口，并返回输入的值， 父窗口为 <i translate="no">parent</i>, 标题栏为 <i translate="no">title</i>, 显示信息为 <i translate="no">label</i>, 值为 <i translate="no">value</i>, 最小值为 <i translate="no">minValue</i>, 最大值为 <i translate="no">maxValue</i>, 步进为 <i translate="no">step</i>, 是否点击确定按钮 <i translate="no">ok</i>, 窗口标志位为 <i translate="no">flags</i>.</p>
<!-- @@@getInt -->
<!-- $$$getItem[overload1]$$$getItemQWidget*constQString&constQString&constQStringList&intboolbool*Qt::WindowFlagsQt::InputMethodHints -->
<h3 class="fn" translate="no" id="getItem"><code class="details extra" translate="no">[static]</code> <span class="type"><a href="https://doc.qt.io/qt/qstring.html" translate="no">QString</a></span> QCtmInputDialog::<span class="name">getItem</span>(<span class="type"><a href="https://doc.qt.io/qt/qwidget.html#QWidget" translate="no">QWidget</a></span> *<i>parent</i>, const <span class="type"><a href="https://doc.qt.io/qt/qstring.html" translate="no">QString</a></span> &amp;<i>title</i>, const <span class="type"><a href="https://doc.qt.io/qt/qstring.html" translate="no">QString</a></span> &amp;<i>label</i>, const <span class="type"><a href="https://doc.qt.io/qt/qstringlist.html" translate="no">QStringList</a></span> &amp;<i>items</i>, <span class="type">int</span> <i>current</i> = 0, <span class="type">bool</span> <i>editable</i> = true, <span class="type">bool</span> *<i>ok</i> = nullptr, <span class="type"><a href="https://doc.qt.io/qt/qt.html#WindowType-enum" translate="no">Qt::WindowFlags</a></span> <i>flags</i> = Qt::WindowFlags(), <span class="type"><a href="https://doc.qt.io/qt/qt.html#InputMethodHint-enum" translate="no">Qt::InputMethodHints</a></span> <i>inputMethodHints</i> = Qt::ImhNone)</h3>
<p>弹出显示一个 ComboBox 选择窗口，并返回选中的字符串， 父窗口为 <i translate="no">parent</i>, 标题栏为 <i translate="no">title</i>, 显示信息为 <i translate="no">label</i>, 候选项目为 <i translate="no">items</i>, 当前显示项为 <i translate="no">current</i>, 是否可编辑 <i translate="no">editable</i>, 是否点击确定按钮 <i translate="no">ok</i>, 窗口标志位为 <i translate="no">flags</i>, 输入法为 <i translate="no">inputMethodHints</i>.</p>
<!-- @@@getItem -->
<!-- $$$getMultiLineText[overload1]$$$getMultiLineTextQWidget*constQString&constQString&constQString&bool*Qt::WindowFlagsQt::InputMethodHints -->
<h3 class="fn" translate="no" id="getMultiLineText"><code class="details extra" translate="no">[static]</code> <span class="type"><a href="https://doc.qt.io/qt/qstring.html" translate="no">QString</a></span> QCtmInputDialog::<span class="name">getMultiLineText</span>(<span class="type"><a href="https://doc.qt.io/qt/qwidget.html#QWidget" translate="no">QWidget</a></span> *<i>parent</i>, const <span class="type"><a href="https://doc.qt.io/qt/qstring.html" translate="no">QString</a></span> &amp;<i>title</i>, const <span class="type"><a href="https://doc.qt.io/qt/qstring.html" translate="no">QString</a></span> &amp;<i>label</i>, const <span class="type"><a href="https://doc.qt.io/qt/qstring.html" translate="no">QString</a></span> &amp;<i>text</i> = QString(), <span class="type">bool</span> *<i>ok</i> = nullptr, <span class="type"><a href="https://doc.qt.io/qt/qt.html#WindowType-enum" translate="no">Qt::WindowFlags</a></span> <i>flags</i> = Qt::WindowFlags(), <span class="type"><a href="https://doc.qt.io/qt/qt.html#InputMethodHint-enum" translate="no">Qt::InputMethodHints</a></span> <i>inputMethodHints</i> = Qt::ImhNone)</h3>
<p>弹出显示一个多行文本输入窗口，并返回输入的字符串， 父窗口为 <i translate="no">parent</i>, 标题栏为 <i translate="no">title</i>, 显示信息为 <i translate="no">label</i>, 显示文本为 <i translate="no">text</i>, 是否点击确定按钮 <i translate="no">ok</i>, 窗口标志位为 <i translate="no">flags</i>, 输入法为 <i translate="no">inputMethodHints</i>.</p>
<!-- @@@getMultiLineText -->
<!-- $$$getText[overload1]$$$getTextQWidget*constQString&constQString&QLineEdit::EchoModeconstQString&bool*Qt::WindowFlagsQt::InputMethodHints -->
<h3 class="fn" translate="no" id="getText"><code class="details extra" translate="no">[static]</code> <span class="type"><a href="https://doc.qt.io/qt/qstring.html" translate="no">QString</a></span> QCtmInputDialog::<span class="name">getText</span>(<span class="type"><a href="https://doc.qt.io/qt/qwidget.html#QWidget" translate="no">QWidget</a></span> *<i>parent</i>, const <span class="type"><a href="https://doc.qt.io/qt/qstring.html" translate="no">QString</a></span> &amp;<i>title</i>, const <span class="type"><a href="https://doc.qt.io/qt/qstring.html" translate="no">QString</a></span> &amp;<i>label</i>, <span class="type"><a href="https://doc.qt.io/qt/qlineedit.html#EchoMode-enum" translate="no">QLineEdit::EchoMode</a></span> <i>echo</i> = QLineEdit::Normal, const <span class="type"><a href="https://doc.qt.io/qt/qstring.html" translate="no">QString</a></span> &amp;<i>text</i> = QString(), <span class="type">bool</span> *<i>ok</i> = nullptr, <span class="type"><a href="https://doc.qt.io/qt/qt.html#WindowType-enum" translate="no">Qt::WindowFlags</a></span> <i>flags</i> = Qt::WindowFlags(), <span class="type"><a href="https://doc.qt.io/qt/qt.html#InputMethodHint-enum" translate="no">Qt::InputMethodHints</a></span> <i>inputMethodHints</i> = Qt::ImhNone)</h3>
<p>弹出显示一个单行文本输入窗口，并返回输入的字符串， 父窗口为 <i translate="no">parent</i>, 标题栏为 <i translate="no">title</i>, 显示信息为 <i translate="no">label</i>, 显示模式为 <i translate="no">echo</i>, 显示文本为 <i translate="no">text</i>, 是否点击确定按钮 <i translate="no">ok</i>, 窗口标志位为 <i translate="no">flags</i>, 输入法为 <i translate="no">inputMethodHints</i>.</p>
<!-- @@@getText -->
<!-- $$$hideEvent[overload1]$$$hideEventQHideEvent* -->
<h3 class="fn" translate="no" id="hideEvent"><code class="details extra" translate="no">[override virtual protected]</code> <span class="type">void</span> QCtmInputDialog::<span class="name">hideEvent</span>(<span class="type"><a href="https://doc.qt.io/qt/qhideevent.html" translate="no">QHideEvent</a></span> *)</h3>
<p>Reimplements: <a href="https://doc.qt.io/qt/qwidget.html#hideEvent" translate="no">QWidget::hideEvent</a>(QHideEvent *event).</p>
<!-- @@@hideEvent -->
<!-- $$$nativeEvent[overload1]$$$nativeEventconstQByteArray&void*qintptr* -->
<h3 class="fn" translate="no" id="nativeEvent"><code class="details extra" translate="no">[override virtual protected]</code> <span class="type">bool</span> QCtmInputDialog::<span class="name">nativeEvent</span>(const <span class="type">QByteArray</span> &amp;<i>eventType</i>, <span class="type">void</span> *<i>message</i>, <span class="type"><a href="https://doc.qt.io/qt/qttypes.html#qintptr-typedef" translate="no">qintptr</a></span> *<i>result</i>)</h3>
<p>Reimplements: <a href="https://doc.qt.io/qt/qwidget.html#nativeEvent" translate="no">QWidget::nativeEvent</a>(const QByteArray &amp;eventType, void *message, qintptr *result).</p>
<!-- @@@nativeEvent -->
<!-- $$$removeTitleBar[overload1]$$$removeTitleBar -->
<h3 class="fn" translate="no" id="removeTitleBar"><span class="type">void</span> QCtmInputDialog::<span class="name">removeTitleBar</span>()</h3>
<p>移除标题栏.</p>
<p><b>See also </b><a href="qctminputdialog.html#setTitleBar" translate="no">setTitleBar</a> and <a href="qctminputdialog.html#titleBar" translate="no">titleBar</a>.</p>
<!-- @@@removeTitleBar -->
<!-- $$$setTitleBar[overload1]$$$setTitleBarQCtmTitleBar* -->
<h3 class="fn" translate="no" id="setTitleBar"><span class="type">void</span> QCtmInputDialog::<span class="name">setTitleBar</span>(<span class="type"><a href="qctmtitlebar.html" translate="no">QCtmTitleBar</a></span> *<i>titleBar</i>)</h3>
<p>设置标题栏 <i translate="no">titleBar</i>.</p>
<p><b>See also </b><a href="qctminputdialog.html#titleBar" translate="no">titleBar</a> and <a href="qctminputdialog.html#removeTitleBar" translate="no">removeTitleBar</a>.</p>
<!-- @@@setTitleBar -->
<!-- $$$showEvent[overload1]$$$showEventQShowEvent* -->
<h3 class="fn" translate="no" id="showEvent"><code class="details extra" translate="no">[override virtual protected]</code> <span class="type">void</span> QCtmInputDialog::<span class="name">showEvent</span>(<span class="type"><a href="https://doc.qt.io/qt/qshowevent.html" translate="no">QShowEvent</a></span> *<i>e</i>)</h3>
<p>Reimplements: <a href="https://doc.qt.io/qt/qwidget.html#showEvent" translate="no">QWidget::showEvent</a>(QShowEvent *event).</p>
<!-- @@@showEvent -->
<!-- $$$titleBar[overload1]$$$titleBar -->
<h3 class="fn" translate="no" id="titleBar"><span class="type"><a href="qctmtitlebar.html" translate="no">QCtmTitleBar</a></span> *QCtmInputDialog::<span class="name">titleBar</span>() const</h3>
<p>返回标题栏.</p>
<p><b>See also </b><a href="qctminputdialog.html#setTitleBar" translate="no">setTitleBar</a> and <a href="qctminputdialog.html#removeTitleBar" translate="no">removeTitleBar</a>.</p>
<!-- @@@titleBar -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> QCustomUi
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/> </div>
</body>
</html>
